package com.example.cms.controller;

import com.example.cms.entity.Customer;
import com.example.cms.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CustomerController {

    @Autowired
    private CustomerService customerService;

    @RequestMapping("addCustomer")//http://localhost:8080/addCustomer?customerName=ss&customerCompany=ss&customerAddre=ss&customerPhone=ss
    public Integer addCustomer(Customer customer){
        return customerService.addCustomer(customer);
    }

    @RequestMapping("updateCustomer")//http://localhost:8080/updateCustomer?customerId=1?customerName=ss&customerCompany=ss&customerAddre=ss&customerPhone=ss
    public Integer updateCustomer(Customer customer){
        return customerService.updateCustomer(customer);
    }


}
